package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.db.AnalysisByDay;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {

    @Select("select sum(num_registered) num from tb_analysis_by_day")
    Long queryCumulativeUsers();

    @Select("select sum(num_active) from tb_analysis_by_day where record_date>=#{passDay}")
    Long queryPassDay(String passDay);

    //    @Select("select    sum(num_registered)  num from tb_analysis_by_day where  record_date ='2021-04-13'")
    @Select("select   sum(${columName}) num from tb_analysis_by_day where  record_date =#{dateStr}")
    Long qureyNumByColumAndDate(@Param("columName") String columName,@Param("dateStr")  String dateStr);
    //注意连接符的使用

}
